import { middleware } from '@/utils/middleware'
import { routes } from './router'

import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

middleware.on('logout', () => {
  router.push({ path: '/login' })
})

export default router
